<template>
    <div class="block">
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="formline.page"
            :page-sizes="[5, 10, 15, 20]"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total">
        </el-pagination>
    </div>
</template>

<script>
export default {
    props:{
        total:{
            type: Number,
            default: 0
        },
        pageSize:{
            type:Number,
            default:10
        }
        
    },
    data(){
        return{
            formline:{
                page:1,
                psize:this.pageSize
            }
        }
    },
    methods:{
        handleSizeChange(val){//每条页数
            // console.log('handleSizeChange', val)
            this.formline.page = val
            this.$emit('changePage',this.formline)
        },
        handleCurrentChange(val){//当前页
            // console.log('handleCurrentChange', val)   
            this.formline.psize = val
            this.$emit('changePage',this.formline)
        }
    }
    
}
</script>

<style>

</style>